<include file="Public:header" />
<include file="Public:leftside" />
<link rel="stylesheet" type="text/css" href="/Store/css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="/Store/css/cuoxiao.css"/>
<style>
.hide_m{display: none}
.modal-infp-style{width:90%;margin:10px auto;}
.modal-infp-style table{width:100%;}
.modal-infp-style table tr td{border: 1px solid #e6e6e6; padding: 10px;}
.modal {width: 800px;height: 420px;}
.modal-dialog{padding: 0;}
</style>
<div class="main-content">
	<div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
		<ul class="breadcrumb" style="margin: 0;">
			<li> <i class="icon-home home-icon"></i> <a href="/">首页</a> </li>
			<li class="active">拼团管理</li>
		</ul>

	</div>
	<div class="page-content" style="padding:0;">
	<div class="listContent" style="margin: 10px 0 0 0;">
    	<table class="table table-striped table-bordered table-hover" width="100%" border="0" cellpadding="0" cellspacing="0" >
            <thead>
        	<tr class="f_black bg_gray">
				<th style="width: 50px;" align="center">ID</th>
                <th style="width: 30%;">商品名称</th>
               	<th>拼团人数</th>
                <th>限购</th>
                <th>价格（原价/售价/拼团价）</th>
                <th>拼团开始时间</th>
                <th>拼团结束时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
          
            	<foreach name="rs" item="vo">
	            <tr class="list" >
            	
                	<td>{$vo.id}</td>
		            <td style="text-align:left;">{$vo.title}</td>
		            <td>{$vo.tuan_num}</td>
		            <td>{$vo.tuan_buynum}</td>
		            <td>{$vo.oprice}/{$vo.price}/{$vo.tuan_price}</td>
		            <td>{:date('Y-m-d H:i:s',$vo['tuanz_endtime'])}</td>
		            <td>{:date('Y-m-d H:i:s',$vo['tuanz_endtime'])}</td>
		            <td>
		            	<a href="{:U('Shop/add',array('id'=>$vo['id']))}">编辑</a>
		            </td>
		           
	            </tr>
	            </foreach>
	        
            </tbody>
        </table>
        <div class="paging">{$page}</div>
    </div>
   </div>
</div>
<script type="text/javascript">
function couponTypeInfo(coupon_type_id){
		$("#couponTypeInfo").modal("show");
		$.ajax({
			type:"post",
			url : "{:U('promotion/getcoupontypeinfo')}",
			data : {
				"coupon_type_id" : coupon_type_id
			},
			success : function(data) {
				$("#coupon_name").text(data["coupon_name"]);
				$("#money").text(data["money"]+"元");
				$("#count").text(data["count"]);
				if(data["max_fetch"] == 0){
					$("#max_fetch").text('不限');
				}else{
					$("#max_fetch").text(data["max_fetch"]+"次");
				}
				$("#at_least").text(data["at_least"]+"元");
				$("#time").text(data["start_time"]+"到"+data["end_time"]);
			}
		})
	}

</script>

<!-- 模态框（Modal） -->
<div class="modal fade hide_m" id="couponTypeInfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">优惠券详情</h4>
            </div>
            <div class="modal-body">
            	<div class="modal-infp-style">
            		<table>
            			<tr>
            				<td>类型名</td>
            				<td id="coupon_name"></td>
            			</tr>
            			<tr>
            				<td>面额</td>
            				<td id="money"></td>
            			</tr>
            			<tr>
            				<td>发放数量</td>
            				<td id="count"></td>
            			</tr>
            			<tr>
            				<td>每人最大领取数</td>
            				<td id="max_fetch"></td>
            			</tr>
            			<tr>
            				<td>满多少元使用</td>
            				<td id="at_least"></td>
            			</tr>
            			<tr style="display:none;">
            				<td>领取人等级</td>
            				<td id="need_user_level"></td>
            			</tr>
            			<tr>
            				<td>有效时间</td>
            				<td id="time"></td>
            			</tr>
            		</table>
            	</div>
            </div>
            <div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button></div>
        </div>
    </div>
</div>
<include file="Public:footer" />